import React from 'react';
import { 
  Modal,
  Form, 
  Input, 
  Button,
} from 'antd';

interface CreateFormProps {
  modalVisible: boolean;
  onCancel: () => void;
}



const CreateForm: React.FC<CreateFormProps> = (props) => {
  const { modalVisible, onCancel } = props;


  const handleHidden =()=> {
    onCancel()
  }
  const layout = {
    labelCol: { span: 8 },
    wrapperCol: { span: 16 },
  };
 
  const onFinishFailed = errorInfo => {
    console.log('Failed:', errorInfo);
  };
  const handleSumbit = async (values) => { 
    const {typeName,typeParentId} =values
    const params={
      typeName,
      typeParentId
    }
    
  };  
  return (
    <Modal
      destroyOnClose
      title="新增"
      visible={modalVisible}
      onCancel={handleHidden} 
    >
 <Form
      {...layout}
      name=" "
      initialValues={{ remember: true }}
      onFinish={handleSumbit}
      onFinishFailed={onFinishFailed}
    >
      <Form.Item
        label="实践类型名称"
        name=" "
        rules={[{ required: true, message:'请输入实践类型的名称！' }]}
      >
        <Input />
      </Form.Item> 
    </Form> 
    </Modal>
  );
};

export default CreateForm;
